package com.tasogo.comm;

import android.content.Context;
import android.util.Log;
import com.SunSoft.PhoneRemoteControl.MainControl;
import java.lang.reflect.Method;

public final class g
  implements e
{
  private Object a;
  private Class b;
  private Method c;
  private Method d;

  public g()
  {
    try
    {
      this.a = MainControl.i().getSystemService("irda");
      this.a.getClass();
      this.b = this.a.getClass();
      this.d = this.b.getMethod("read_irsend", new Class[0]);
      this.c = this.b.getMethod("write_irsend", new Class[] { String.class });
      if (this.a == null)
      {
        a("irda", "IR service is null");
        return;
      }
      a("irda", "get IR service");
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  private static void a(String paramString1, String paramString2)
  {
    if (!(MainControl.e))
      return;
    Log.d(paramString1, paramString2);
  }

  public final boolean a(String paramString, int paramInt)
  {
    try
    {
      if (this.a == null)
        return false;
      this.c.invoke(this.a, new Object[] { paramString });
      a("irda", "S4 send OK");
      return true;
    }
    catch (Exception paramString)
    {
    }
    return false;
  }
}